<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
</head>
<style>
    html,
    body {
        background-color: #fff;
    }

    .placeholder_div {
        background-color: #fbf9f9;

    }

    .tab_div {
        padding: 0.8rem;
        background-color: #fff;
        border-bottom: 1px solid #e8e8e8;
    }

    .tab_div .tab_item {
        display: inline-block;
        padding: 0.2rem 0.5rem;
        font-size: 0.6rem;
        color: #565656;
        margin-right: 0.8rem;
        border-radius: 0.2rem;
        border: 1px solid #e8e8e8;
    }

    .tab_active {
        background-color: #f75349;
        color: #fff !important;
        border: none !important;
    }

    .order_div {
        padding: 0 0.8rem;
    }

    .order_div .order_item {
        padding: 1rem;
        border-radius: 1rem;
        box-shadow: 0px 0.1rem 0.7rem 0px rgba(0, 0, 0, 0.07);
        margin-top: 1rem;
    }

    .order_div .order_item .top {
        color: #303030;
        font-size: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .order_div .order_item .top span {
        color: #838383;
        font-size: 0.6rem;
        margin: 0 0.5rem;
    }

    .order_div .order_item .top p {
        color: #2E8EFF;
        font-size: 0.5rem;
        padding: 0.2rem 0.5rem;
        border-radius: 0.2rem;
        background-color: #F2F2F2;
        float: right;
    }

    .detail_item {
        width: 100%;
    }


    .detail_item {
        line-height: 1.2rem;
        font-size: 0.6rem;
    }

    .detail_item .tou {
        color: #838383;
        width: 4rem;
        float: left;
        text-align: center;
    }

    .detail_item .wei {
        color: #565656;
        display: inline-block;
        width: 11rem;
    }

    .none {
        font-size: 0.6rem;
        margin: 1rem 0;
        text-align: center;
    }
</style>

<body>
    <div  id="app" v-cloak>
        <div class="placeholder_div"></div>

        <!-- <div class="tab_div">
            <div class="tab_item tab_active">
                全部 12
            </div>
            <div class="tab_item">
                易感冒 3
            </div>
            <div class="tab_item">
                咳嗽 4
            </div>
            <div class="tab_item">
                盗汗 5
            </div>
        </div> -->

        <div class="order_div">
            <div class="order_item" @click="go_fangan_win(item.id)" v-for="item in fangan_list">
                <div class="top">{{item.name}}
                    <span v-if="item.sex == 1">男</span>
                    <span v-if="item.sex == 2">女</span>
                    <span>{{item.age}}岁</span>
                    <p>{{item.dosageForm}}</p>
                </div>
                <p class="detail_item">
                    <span class="tou">诊 断：</span>
                    <span class="wei p_hide">{{item.diseases}}</span>
                </p>
                <p class="detail_item">
                    <span class="tou">处 方：</span>
                    <span class="wei p_hide">{{item.prescription}}</span>
                </p>
                <p class="detail_item">
                    <span class="tou">帖 数：</span>
                    <span class="wei p_hide">{{item.quantity}}帖</span>
                </p>
                <p class="detail_item">
                    <span class="tou">开方时间：</span>
                    <span class="wei p_hide">{{item.createTime}}</span>
                </p>
            </div>
        </div>
        <p class="none">已经没有更多了~</p>
    </div>
</body>

</html>
<script src="../script/set_root.js"></script>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hb.js"></script>
<script type="text/javascript" src="../script/vue.js"></script>
<script type="text/javascript">
    apiready = function () {
        hb_ready();

        get_ajax("prescribe/plan/listpage", {
            doctorId: $api.getStorage("emp").userId,
            start: app.page,
            pagesize: 10,
        }, function (res, err) {
            if (res.code == 200) {
                // alert(JSON.stringify(res))
                app.fangan_list = res.data.data
            } else {
                alert("网络不通畅，请稍后再试！")
            }
        })
    }
    //使用vue对数据进行绑定
    var app = new Vue({
        el: '#app',
        data: {
            page: 1,
            fangan_list: [],
        },
        methods: {
            go_fangan_win: function (id) {
                api.openWin({
                    name: "fangan_win",
                    url: "fangan_win.html",
                    pageParam: {
                        id: id
                    }
                })
            }
        },

    })
</script>